//
//  DYLoginRegisterTextField.m
//  BaiSi
//
//  Created by mac on 16/10/20.
//  Copyright © 2016年 DeYi. All rights reserved.
//

#import "DYLoginRegisterTextField.h"
#import "UITextField+Placeholder.h"

@implementation DYLoginRegisterTextField


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

//从XIb中加载
- (void)awakeFromNib {
    
    //设置光标颜色
    self.tintColor = [UIColor whiteColor];
    
    //设置文本颜色
    self.textColor = [UIColor whiteColor];
    
    //设置占位文字ys
    self.placeholderColor = [UIColor lightGrayColor];
    
    [self addTarget:self action:@selector(changePlaceholdColor) forControlEvents:UIControlEventEditingDidBegin];
    
    [self addTarget:self action:@selector(initialPlaceholdColor) forControlEvents:UIControlEventEditingDidEnd];
}

-(void)initialPlaceholdColor{
    
    self.placeholderColor = [UIColor lightGrayColor];
}

- (void)changePlaceholdColor {
    
    self.placeholderColor = [UIColor whiteColor];
}

@end
